/*
 * Copyright (c) 2005, 2014 vacoor
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.vacoor.nothing.security;

import org.vacoor.nothing.web.servlet.WebRequestContext;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author vacoor
 */
public class WebUtils {
    public static final String TEMPDIR = "javax.servlet.context.tempdir";
    public static final String T = "java.io.tmpdir";

    public static void s(HttpServletResponse resp) {
        resp.setHeader("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate");
        resp.setHeader("Pragma", "no-cache");
    }

    String getRealPath() {
        WebRequestContext context = WebRequestContext.getContext();
        return context.getServletContext().getRealPath("");
    }
}
